package com.situ.water_system.Interceptor;

import com.situ.water_system.util.Mingli;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class Interceptorming implements HandlerInterceptor {
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws IOException {
        Object user = request.getSession().getAttribute("user");
        if(user==null){
            response.sendRedirect("/login.html");
        }
        System.out.println("lkjlkj");
        return true;
    }
}
